package com.weiqk.pmdemo.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.util.Date;

@Data
@ApiModel("支付环节")
@Entity     // 作为hibernate 实体类
@Table(name = "PM_PAY_LINK")
public class PayLink {

//   PAY_LINK_ID
//    PURCHASE_ID	NUMBER	16	*EID
//    AMOUNT	NUMBER	10	2
//    SCHEDULED_PAY_DATE	DATE	7
    @ApiModelProperty("付款id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "PAY_LINK_ID")
    private int PayLinkId;

//    @ApiModelProperty("采购id")
//    @Column(name = "PURCHASE_ID")
//    private int PurchaseId;

    @ApiModelProperty("金额")
    @Column(name = "AMOUNT")
    private int Amount;

    @ApiModelProperty("计划付款日期")
    @Column(name = "SCHEDULED_PAY_DATE")
    private Date ScheduledPayDate;

    @ApiModelProperty("备注说明")
    @Column(name = "REMARKS")
    private String Remarks;

    @ApiModelProperty("付款日期")
    @Column(name = "COMPLETE_DATE")
    private Date CompleteDate;

    @ApiModelProperty("完成标识")
    @Column(name = "COMPLETE_FLAG")
    private int CompleteFlag;
//    CREATE_TIME
    @Column(name = "CREATE_TIME")
    private Date CreateTime;
    //    CREATOR_ID
    @Column(name = "CREATOR_ID")
    private int CreatorId;
    //    CREATOR_NAME
    @Column(name = "CREATOR_NAME")
    private String CreatorName;
    //    UPDATE_TIME
    @Column(name = "UPDATE_TIME")
    private Date UpadteTime;
    //    UPDATER_ID
    @Column(name = "UPDATER_ID")
    private int UpadterId;
    //    UPDATER_NAME
    @Column(name = "UPDATER_Name")
    private String UpadterName;
    //    VALID_FLAG
    @Column(name = "VALID_FLAG")
    private int ValidFlag;

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) //  级联保存 更新 删除 刷新 延迟加载
    @JoinColumn(name = "PURCHASE_ID")   // 外键关联
    private Purchase purchase;
}
